package cn.snmp.mutual.uk.net;

import java.io.*;

public class StreamPortItem {
    static final String version_id = "@(#)$Id: StreamPortItem.java,v 1.4 2006/02/09 14:14:50 birgit Exp $ Copyright Westhawk Ltd";
    private String hostAddress;
    private int port;
    private ByteArrayInputStream stream;

    public StreamPortItem(final String address, final int newPort, final ByteArrayInputStream in) {
        this.hostAddress = address;
        this.port = newPort;
        this.stream = in;
    }

    public String getHostAddress() {
        return this.hostAddress;
    }

    public int getHostPort() {
        return this.port;
    }

    public ByteArrayInputStream getStream() {
        return this.stream;
    }

    @Override
    public String toString() {
        final StringBuffer buffer = new StringBuffer(this.getClass().getName());
        buffer.append("[");
        buffer.append("hostAddress=").append(this.hostAddress);
        buffer.append(", hostPort=").append(this.port);
        buffer.append(", #bytes=").append(this.stream.available());
        buffer.append("]");
        return buffer.toString();
    }
}
